package com.ruoyi.project.hissystem.service.impl;

import com.ruoyi.project.hissystem.domain.HisRole;
import com.ruoyi.project.hissystem.mapper.HisRoleMapper;
import com.ruoyi.project.hissystem.service.HisRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : 杨磊
 * @date : 15:06 2021/8/19
 */
@Service
public class HisRoleServiceImpl implements HisRoleService {

     //声明mapper层属性
    @Autowired
    private HisRoleMapper hisRoleMapper;


    /**
     * 1.分页动态查询角色信息
     * @param role
     * @return
     */
    @Override
    public List<HisRole> selectRoleList(HisRole role) {
        return hisRoleMapper.selectRoleList(role);
    }

    /**
     *2.新增角色信息
     * @param role
     * @return
     */
    @Override
    public int insertRole(HisRole role) {
        return hisRoleMapper.insertRole(role);
    }

    /**
     * 3.根据角色id查询角色信息
     * @param roleId
     * @return
     */
    @Override
    public HisRole selectRoleById(Long roleId) {
        return hisRoleMapper.selectRoleById(roleId);
    }

    /**
     * 4.修改角色信息
     * @param role
     * @return
     */
    @Override
    public int updateRole(HisRole role) {
        return hisRoleMapper.updateRole(role);
    }

    /**
     * 5.批量删除角色信息
     * @param roleIds
     * @return
     */
    @Override
    public int deleteRoleByIds(Long[] roleIds) {
        return hisRoleMapper.deleteRoleByIds(roleIds);
    }
}
